package com.example.demo.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-22
 * Time: 12:52
 */
@Controller
public class UserController {

    // 读取配置文件 通过 @Value 注解
    @Value("${server.port}")
    private String port;

    @ResponseBody // 返回非静态页面
    @RequestMapping("/sayhi") // 一级路由 最好用小写
    public String sayHi() {

        return "hello word | port: " + port;
    }
}
